<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>

    // let arr = [100, 200, 300]
    // let result = arr.reduce((total, item) => {
    //   return total += item
    // }, 0)
    // console.log(result)


    let arr = [
      { id: 1001, name: "八戒", weight: 100 },
      { id: 1002, name: "悟空", weight: 70 },
      { id: 1003, name: "唐僧", weight: 120 },
      { id: 1004, name: "沙僧", weight: 160 },
    ]

    let result = arr.reduce((total, item, index, arr) => {
      return total += item.weight*2
    }, 0)
    console.log(result);





  </script>
</head>

<body>

</body>

</html>